package com.syni.mdd.sjb.common.datatreaure.controller.protect.dataTreasure.saasminapp;

import com.syni.mdd.sjb.common.component.utils.common.annotations.CheckUserIdentity;
import com.syni.mdd.sjb.common.datatreaure.controller.BaseController;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rq.saasminapp.config.*;
import com.syni.mdd.sjb.common.datatreaure.service.databank.saasminapp.HomeConfigService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


@RestController
@RequestMapping("/minApp/home")
public class HomeConfigController extends BaseController {

    @Autowired
    private HomeConfigService homeConfigService;

    @PostMapping("/getDecorationEntrance")
    @ApiOperation(value = "获取领券入口设置")
    @CheckUserIdentity
    public Map<String,Object> getDecorationEntrance(@RequestBody AppidVo appidVo){
        return homeConfigService.getDecorationEntrance(appidVo);
    }

    @PostMapping("/getDecorationBanner")
    @ApiOperation(value = "获取轮播广告")
    @CheckUserIdentity
    public Map<String,Object> getDecorationBanner(@RequestBody AppidVo appidVo){
        return homeConfigService.getDecorationBanner(appidVo);
    }

    @PostMapping("/getDecorationImgNav")
    @ApiOperation(value = "获取图片导航")
    @CheckUserIdentity
    public Map<String,Object> getDecorationImgNav(@RequestBody AppidVo appidVo){
        return homeConfigService.getDecorationImgNav(appidVo);
    }

    @PostMapping("/setEntrance")
    @ApiOperation(value = "领券入口设置")
    @CheckUserIdentity
    public Map<String,Object> setEntrance(@RequestBody SetEntranceRqVo setEntranceRqVo){
        return homeConfigService.setEntrance(setEntranceRqVo);
    }

    @PostMapping("/setImgNav")
    @ApiOperation(value = "设置图片导航")
    @CheckUserIdentity
    public Map<String,Object> setImgNav(@RequestBody SetImgNavRqVo setImgNavRqVo){
        return homeConfigService.setImgNav(setImgNavRqVo);
    }

    @PostMapping("/setBanner")
    @ApiOperation(value = "设置轮播广告")
    @CheckUserIdentity
    public Map<String,Object> setBanner(@RequestBody SetBannerVo setBannerVo){
        return homeConfigService.setBanner(setBannerVo);
    }

    @PostMapping("/getPageJson")
    @ApiOperation(value = "获取页面列表")
    @CheckUserIdentity
    public Map<String,Object> getPageJson(@RequestBody StoreIdVo storeIdVo){
        return homeConfigService.getPageJson(storeIdVo);
    }

    @PostMapping("/getStoreStyle")
    @ApiOperation(value = "获取当前店铺的样式设置")
    @CheckUserIdentity
    public Map<String,Object> getStoreStyle(@RequestBody AppidVo appidVo){
        return homeConfigService.getStoreStyle(appidVo);
    }

    @PostMapping("/saveStoreStyle")
    @ApiOperation(value = "保存店铺样式设置")
    @CheckUserIdentity
    public Map<String,Object> saveStoreStyle(@RequestBody SaveStoreStyleVo saveStoreStyleVo){
        return homeConfigService.saveStoreStyle(saveStoreStyleVo);
    }

    @PostMapping("/getNavigation")
    @ApiOperation(value = "获取瓷片区导航")
    @CheckUserIdentity
    public Map<String,Object> getNavigation(@RequestBody AppidVo appidVo){
        return homeConfigService.getNavigation(appidVo);
    }

    @PostMapping("/setNavigation")
    @ApiOperation(value = "设置瓷片区导航")
    @CheckUserIdentity
    public Map<String,Object> setNavigation(@RequestBody SetNavigationVo setNavigationVo){
        return homeConfigService.setNavigation(setNavigationVo);
    }

}
